package example.github;

import com.google.gson.JsonArray;
import feign.*;

import java.util.*;

public class Test1 {

    public interface WorkflowClient {

        @RequestLine("POST /process-api/runtime/process-instances")
        @Headers("Content-Type: application/json")
        @Body("%7B\"tenantId\":\"{tenantId}\",\"processDefinitionKey\":\"{key}\",\"variables\":{vars}%7D")
        public void startProcessInstanceByKey(@Param("tenantId") String tenantId, @Param("key") String key, @Param("vars") Map[] vars);
    }

    public static void main(String[] args) {
        System.setProperty("http.proxyHost","127.0.0.1");
        System.setProperty("java.net.useSystemProxies","false");
        System.setProperty("http.proxyPort","8089");
        System.setProperty("http.proxyHost","127.0.0.1");
        System.setProperty("http.proxyPort","8089");
        String key = "holidayRequest-exam4";
        String tenantId = "tenantId";
        WorkflowClient client = Feign.builder().target(WorkflowClient.class,"http://127.0.0.1:8081/");
        Map<String,Object> vars = new HashMap<>();
        Map[] var1 = new Map[1];
        var1[0] = vars;
        client.startProcessInstanceByKey(tenantId,key,var1);
//        List<String> list1 = Arrays.asList("a","ab","c");
//        System.out.println(list1.stream().filter(str->str.length() > 1).count());
//        Map<Integer,String> map = new HashMap<>();
//        map.put(1, "a");
//        map.put(2, "b");
//        System.out.println(map.entrySet().stream().filter(e -> e.getKey() > 1).count());
    }
}
